#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
struct point
{
	int a;
	int b;
};
struct point find_num(int arr[3][3],int n)
{
	int x = 0;
	int y = 2;
	struct point p = { -1,-1 };
	while (x < 3 && y >= 0)
	{
		if (arr[x][y] < n)
			x++;
		else if (arr[x][y] > n)
			y--;
		else
		{
			p.a = x;
			p.b = y;
			break;

		}
	}
	return p;
}
int main()
{
	int arr[3][3] = { 1,2,3,4,5.6,7,8,9 };
	int n = 0;
	scanf("%d", &n);
	struct point p = find_num(arr,n);
	printf("%d %d",p.a,p.b);
	return 0;
}